<%-- 
    Document   : statistic
    Created on : Dec 4, 2011, 9:37:04 PM
    Author     : Venus
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.*, Beans.ThamSoHT,Models.ThamSoHT_Model,  Models.NhomMA_Model"%>
<!--
Danh sách các tham số hệ thống ở trang này :
order      areainfo     areamsg     status      arealang
newarea    areaname     save        action      arealist
enable     disable      search
-->
<script type="text/javascript">
    function keypress(e){
        //Hàm dùng để ngăn người dùng nhập các ký tự khác ký tự số vào TextBox
        var keypressed = null;
        if (window.event)
        {
            keypressed = window.event.keyCode; //IE
        }
        else
        {
            keypressed = e.which; //NON-IE, Standard
        }
        if (keypressed < 48 || keypressed > 57 )
        { //CharCode của 0 là 48 (Theo bảng mã ASCII)
            //CharCode của 9 là 57 (Theo bảng mã ASCII)
            if (keypressed == 8 || keypressed == 127  )
            {//Phím Delete và Phím Back
                return;
            }
            return false;
        }
    }
</script>
<%
            int langid = (Integer) session.getAttribute("langid"); // ngôn ngữ hiện tại
            String dsts = " 'chartturnoverr', 'viewchart', 'quantityfood', 'turnovercustomer', 'toptable', 'topfood', 'datemsg', 'notice', 'rightmsg', 'report', 'all', 'food', 'foodgroups', 'datestart', 'enddate', 'statisticstype', 'statistics', 'turnoverbill', 'turnoverarea', 'turnoveruser', 'turnoverfood' ";
            ThamSoHT[] mdsts = ThamSoHT_Model.DSThamSo(dsts, langid); // mảng chứa các tham số của trang này.

            String all = mdsts[0].getTenTS();
            String chartturnoverr = mdsts[1].getTenTS();
            String datemsg = mdsts[2].getTenTS();
            String datestart = mdsts[3].getTenTS();
            String enddate = mdsts[4].getTenTS();
            String food = mdsts[5].getTenTS();
            String foodgroups = mdsts[6].getTenTS();
            String notice = mdsts[7].getTenTS();
            String quantityfood = mdsts[8].getTenTS();
            String report = mdsts[9].getTenTS();
            String rightmsg = mdsts[10].getTenTS();
            String statistics = mdsts[11].getTenTS();
            String statisticstype = mdsts[12].getTenTS();
            String topfood = mdsts[13].getTenTS();
            String toptable = mdsts[14].getTenTS();
            String turnoverarea = mdsts[15].getTenTS();
            String turnoverbill = mdsts[16].getTenTS();
            String turnovercustomer = mdsts[17].getTenTS();
            String turnoverfood = mdsts[18].getTenTS();
            String turnoveruser = mdsts[19].getTenTS();
            String viewchart = mdsts[20].getTenTS();


            String msgright = notice + "/" + rightmsg;
            String msgdate = notice + "/" + datemsg;
%>
<script type="text/javascript">
    $(function(){
        $('#datepicker1').datepicker($.datepicker.regional['vi']);
        $( "#datepicker1" ).datepicker( "option", "dateFormat","dd/mm/yy");
        $('#datepicker2').datepicker($.datepicker.regional['vi']);
        $( "#datepicker2" ).datepicker( "option", "dateFormat","dd/mm/yy");
    });
</script>
<h1><img style="margin-right: 13px; opacity: 0.8; margin-top: 5px;" alt="" src="../images/statics11.png"><%=statistics%></h1>
<div class="cb"></div>

<div class="bloc" style="width: 70%;  padding-bottom: 20px; margin-top: 15px;">
    <div class="title"></div>
    <form name="frmcook" action="" id="frmcook" method="POST" target="_blank">
        <div style="width: 110px; float: left; margin-top: 30px; margin-left: 30px; font-weight: bold;"><%=statisticstype%></div>
        <select id="loaithongke" class="text" style="margin-top: 30px; width: 170px; height: 24px; padding-top: 2px;" onchange="ShowDKLoc(this.value, this.name)" name="<%=msgright%>">
            <option value="turnoverfood"><%=turnoverfood%></option>
            <option value="turnoveruser"><%=turnoveruser%></option>
            <option value="turnoverarea"><%=turnoverarea%></option>
            
            <option value="turnovercustomer"><%=turnovercustomer%></option>
            <option value="topfood"><%=topfood%></option>
            <option value="toptable"><%=toptable%></option>
            <option value="chartturnoverr"><%=chartturnoverr%></option>
        </select>
        <div id="dieukienloc" style=" margin-top: 25px; margin-left: 30px;">
            <div style=" width: 110px; float: left;"><%=datestart%></div>
            <input type="textbox" class="text ngaybd" name="ngaybd" id="datepicker1" onchange="CheckDateStatics()" style=" width: 170px; float: left;">
            <div style=" width: 110px; float: left; margin-left: 40px;"><%=enddate%></div>
            <input type="textbox" class="text ngaykt" name="ngaykt" id="datepicker2" onchange="CheckDateStatics()" style=" width: 170px; "><br/>
            <div style=" width: 110px; float: left; margin-top: 20px;"><%=foodgroups%></div>
            <select class="text" name="manhomma" style=" width: 170px; float: left; margin-top: 20px; height: 24px; padding-top: 2px;">
                <option value="all"><%=all%></option>
                <%
                            Vector v = new Vector();
                            NhomMA_Model nma = new NhomMA_Model();
                            v = nma.LayDSNMA(langid);
                            for (int i = 0; i < v.size(); i++) {
                            Beans.NhomMA nmab = (Beans.NhomMA) v.elementAt(i);%>
                <option value="<%=nmab.getMaNMA()%>"><%=nmab.getTenNMA()%></option>
                <%  }%>
            </select>
            <div style=" width: 110px; float: left; margin-left: 40px; margin-top: 20px;"><%=food%></div>
            <input type="textbox" class="text tenmonan" name="tenmonan" style=" width: 170px; margin-top: 20px;"><br/>
            <div style=" width: 110px; float: left; margin-top: 20px; "><%=quantityfood%></div>
            <input type="textbox" class="text soluong" name="soluong" style=" width: 50px; float: left; margin-top: 20px;" onkeypress="return keypress(event)">
            <div style=" width: 200px; float: right; margin-top: 20px;">
                <input type="checkbox" id="chkchart" name="chkchart" value="a" style="margin-right: 15px;"><%=viewchart%>
            </div>            
        </div>
            <input type="hidden" id="submitstatics" value="true">
            <div class="cb"></div>
        <input type="button" onclick="LapBaoCao(this.alt, this.id, this.lang, this.name)"  lang="1" name="<%=msgright%>" id="<%=msgdate%>" style=" margin-left: 195px; margin-top: 25px; clear: both;" class="button" value="<%=report%>" >
    </form>
</div>
<div id="rsreport" class="bloc">
</div>

